<?php

namespace App\Listener;

use App\Events\AgentCreated;
use App\Events\AgentUpdated;
use App\Interfaces\agent\AgentInterFace;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class AgentUpdate implements ShouldQueue
{
    protected $agentInterFace;
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(AgentInterFace $agentInterFace)
    {
        $this->agentInterFace=$agentInterFace;
    }

    /**
     * Handle the event.
     *
     * @param  AgentCreated  $event
     * @return void
     */
    public function handle(AgentUpdated $event)
    {

        //获取地图lat lgo
        $this->agentInterFace->agentGeo($event->agent);
    }
}
